package com.liuxingwu.pojo;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author 扫地生_LiuXingWu
 */
public class People {
    private String name;
    // 如果显式定义了AutoWired的required属性为false，说明这个对象可以为Null，否则不允许为空
    @Autowired(required = false)
    private Cat cat;
    @Autowired
    private Dog dog;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Cat getCat() {
        return cat;
    }

    public void setCat(Cat cat) {
        this.cat = cat;
    }

    public Dog getDog() {
        return dog;
    }

    public void setDog(Dog dog) {
        this.dog = dog;
    }

    @Override
    public String toString() {
        return "People{" +
                       "name='" + name + '\'' +
                       ", cat=" + cat +
                       ", dog=" + dog +
                       '}';
    }
}
